var checkMPassForm = function() {
	
	var oldpassword = $.trim($("#oldpass").val());
	var newpassword = $.trim($("#newpass").val());
	var rnewpassword = $.trim($("#comfirmPass").val());
	
	if (oldpassword == '') {		
					
		msg = "当前密码不能为空！";
		alert(msg);
		return false;
		
	} else if (newpassword == '') {
		
		msg = "新密码不能为空！";
		alert(msg);
		return false;
		
	}  else if (newpassword.length < 6) {
		
		msg = "密码不能少于6位！";
		alert(msg);
		return false;
		
	}else if (rnewpassword != newpassword) {
		
		msg = "两次密码不一致！";
		alert(msg);
		return false;
		
	} else {
		
		return true;
		
	}
}
var checkAddForm = function() {
	
	var username = $.trim($("#username").val());
	var password = $.trim($("#password").val());
	
	if (username == '') {		
					
		msg = "用户名不能为空！";
		alert(msg);
		return false;
		
	} else if (password == '') {
		
		msg = "密码不能为空！";
		alert(msg);
		return false;
		
	}else if (/.*[\u4e00-\u9fa5]+.*$/.test(password)) {
		
		msg = "密码不能为汉字！";
		alert(msg);
		return false;
		
	} else if (password.length < 6) {
		
		msg = "密码不能少于6位！";
		alert(msg);
		return false;
		
	} else {
	
		return true;
	} 
}
var checkMInfoForm = function() {
	
	var username = $.trim($("#username").val());
	var userphone = $.trim($("#userphone").val());
	var major = $.trim($("#major").val());
	var qq = $.trim($("#qq").val());
	
	if (username == '') {		
					
		msg = "用户名不能为空！";
		alert(msg);
		return false;
		
	} else if (userphone == '') {
		
		msg = "手机号不能为空！";
		alert(msg);
		return false;
		
	}else if (!(/^\d{11}$/.test(userphone))) {
		
		msg = "请输入正确格式的手机号码！";
		alert(msg);
		return false;
		
	}else if (major == '') {
		
		msg = "专业名称不能为空！";
		alert(msg);
		return false;
		
	}else if (qq == '') {
		
		msg = "QQ号不能为空！";
		alert(msg);
		return false;
		
	}else if (!(/^[0-9]*$/.test(qq))) {
		
		msg = "QQ只能为数字！";
		alert(msg);
		return false;
		
	} else {
	
		return true;
	} 
}

var checkMHImgForm = function() {
	
	var upload = $.trim($("#upload").val());
	if(upload == '' || upload == null) {
		alert("请选择图片！");
		return false;
	}else if(!(/.*[\.jpg\.png\.gif]$/.test(upload))) {
		var obj = document.getElementById('upload');
		if (navigator.userAgent.indexOf("MSIE")>0) {      
         	obj.outerHTML+=''; 
         } else { 
             obj.value = ''; 
         } 
		alert("文件只能为jpg,gif或png格式！");
		return false;
	}
	
	document.headform.action = 'front/UserFile!ModifyImg';
	return true;
	
}

var dd = function() {
	if(document.headform.action=='front/UserFile!ModifyImg' || document.headform.action=='') {
		return checkMHImgForm();
	}
	return true;
	
}

var checkAccountForm = function() {
	
	var moneyQuantity = $.trim($("#moneyQuantity").val());
	
	var oEditor = FCKeditorAPI.GetInstance('account.description');
	var description = oEditor.GetXHTML();  
	if (moneyQuantity == '') {		
					
		msg = "请输入金额数！";
		oEditor.SetHTML("");
		alert(msg);
		return false;
		
	} else if (!(/^[0-9]*\.\d\d$/.test(moneyQuantity))) {
		
		msg = "金额数格式不正确！";
		alert(msg);
		oEditor.SetHTML("");
		return false;
		
	}else if (description == '') {
		
		msg = "请填写说明内容！";
		alert(msg);
		oEditor.SetHTML("");
		return false;
		
	} else {
	
		return true;
	} 
}

var checkAccountQForm = function() {
	
	var solution = $.trim($("#solution").val());
	
	if (solution == '') {		
					
		msg = "你并没有输入内容！";
		alert(msg);
		return false;
		
	}  else {
		alert(msg);
		return true;
	} 
}
var checkAQuestion = function() {
	
	var oEditor = FCKeditorAPI.GetInstance('question.questionContent');
	var questionContent = oEditor.GetXHTML();  
	
	if (questionContent == '') {		
					
		msg = "你并没有输入内容！";
		alert(msg);
		oEditor.SetHTML("");
		return false;
		
	}  else {
		return true;
	} 
}
var checkMeetAdd = function() {
   
	var location = $.trim($("#location").val());
	var organizer = $.trim($("#organizer").val());
	var recorder = $.trim($("#recorder").val());
	var joiner = $.trim($("#joiner").val());
	var leaver = $.trim($("#leaver").val());
	var absence = $.trim($("#absence").val());
	var hearer = $.trim($("#hearer").val());
	
	
	
	var mainContentEditor = FCKeditorAPI.GetInstance('meetRecord.mainContent');
	var followThingEditor = FCKeditorAPI.GetInstance('meetRecord.followThing');
	var mainContent = mainContentEditor.GetXHTML();
	var followThing = followThingEditor.GetXHTML();
//	 alert(followThing);
	if(location == '') {
		alert('请填写聚会地点!');
		return false;
	}else if(organizer == '') {
		alert('请填写主持人！');
		return false;
	}else if(recorder == '') {
		alert('请填写记录人');
		return false;
	}else if(joiner == '') {
		alert('请填写出席人员');
		return false;
	}else if(mainContent == '') {
		msg = "请填写会议内容！";
		alert(msg);
		mainContentEditor.SetHTML("");
		return false;
	}else if(followThing == '') {
		msg = "请填写后续跟踪内容！";
		alert(msg);
		followThingEditor.SetHTML("");
		return false;
	}
	
	if(leaver == '') {
		document.getElementById('leaver').value = '无';
	}
	if(absence == '') {
		document.getElementById('absence').value = '无';
	}
	if(hearer == '') {
		document.getElementById('hearer').value = '无';
	}
	
	var startTimeH = document.getElementById('startTimeH').value;
	var startTimeM = document.getElementById('startTimeM').value;
	document.getElementById('startTime').value = startTimeH + startTimeM;
	var endTimeH = document.getElementById('endTimeH').value;
	var endTimeM = document.getElementById('endTimeM').value;
	document.getElementById('endTime').value = endTimeH + endTimeM;
	
	return true;
}

var checkAddMRM = function() {
	return true;
}
function move() {
	document.getElementById('addLink').x = '2px';
				
}
